package com.base.common.httpStatusCode.enumDefine;

import com.base.common.httpStatusCode.interfaceDefine.Tip;

/**
 * @Author Maple.Chen
 * @Description 自定义Controller接口返回JSON中statusCode的定义
 * @Date 17:34 2021/2/9
 **/

public enum StatusCode implements Tip {

    Success("操作成功",1){
        public String nextStepTip(){
            return "success!";
        }
    },
    NoResult("暂无数据",0){
        public String nextStepTip(){
            return "sorry, no date here!";
        }
    },
    Failure("操作失败",-1){
        public String nextStepTip(){
            return "please try again later!";
        }
    },
    NoLogin("暂未登录",-202){
        public String nextStepTip(){
            return "please login first!";
        }
    },
    NoPermission("权限不足",-102){
        public String nextStepTip(){
            return "sorry, you don't have enough access to view!";
        }
    }
    ;

    // 状态码
    public int _statusCode;
    // 状态码说明
    public String explain;

    StatusCode(String _explain,int statusCode){
        _statusCode = statusCode;
        explain = _explain;
    }

    @Override
    public String nextStepTip() {
        return "下一步操作提示";
    }
}
